package io2_homework;

import java.io.*;


public class CopyDemo3Buffered {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("开班桌面壁纸2.jpg");
        BufferedInputStream bis = new BufferedInputStream(fis);
        FileOutputStream fos =new FileOutputStream("开班桌面壁纸2_cp6.jpg");
        BufferedOutputStream bos =new BufferedOutputStream(fos);
        long s = System.currentTimeMillis();
        int d;
        while ((d= bis.read())!=-1){
            bos.write(d);
        }
        long e = System.currentTimeMillis();
        System.out.println(e-s+"ms复制完成!");
        bis.close();
        bos.close();
    }
}
